<template>
	<view class="y-page-common page">
		<image class="img" style="width: 100%; height: 100%; background-color: #eeeeee;" mode="scaleToFill" :src="src">
		</image>
		<view class="btn">
			<button class="btn-80" type="default" @click="jump">立即申请</button>
		</view>
		<template v-if="ewmSrc">
			<image class="ewmimg" style="" mode="scaleToFill" :src="ewmSrc"></image>
			<text class="ewmtext">扫码正式申请</text>
		</template>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				index: 0, //  0-4  打包修改此参数 读取srcs 对应不同产品  
				srcs: [{
						src: '../static/img/edsy.jpg',
						url: '/pages/index/index',
						ewmSrc: '../static/img/ewm/xnyd.png'
					}, // 兴农E贷  选 个人、企业
					{
						src: '../static/img/kjdsy.jpg',
						url: '/pages/science/step',
						ewmSrc: '../static/img/ewm/keji.png'
					}, //科技
					{
						src: '../static/img/xxwyzd.jpg',
						url: '/pages/personal/index'
					}, //新希望养殖贷 个人
					{
						src: '../static/img/grdsy.jpg',
						url: '/pages/personal/index',
						ewmSrc: '../static/img/ewm/phsld.png'
					}, // 普惠饲料贷  个人
					{
						src: '../static/img/rnd.png',
						url: '/pages/personal/index'
					}, // 肉牛贷  个人
				]
			}
		},
		computed: {
			src() {
				return this.srcs[this.index].src
			},
			url() {
				return this.srcs[this.index].url
			},
			ewmSrc() {
				return this.srcs[this.index].ewmSrc || null
			}
		},
		onLoad() {

		},
		onShow() {
			uni.clearStorageSync();
		},
		methods: {
			jump() {
				uni.navigateTo({
					url: this.url
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.page {
		width: 100%;
		height: 100%;
		position: relative;

		.img {
			width: 100%;
			height: 100%;
			position: fixed;
			left: 0;
		}

		.btn {
			width: 100%;
			position: absolute;
			bottom: 200rpx;
			display: flex;
			justify-content: space-around;

			.btn-80 {
				width: 60%;
				margin: 0 auto;
				color: #008FF8;
			}
		}

		.ewmimg {
			position: absolute;
			bottom: 60rpx;
			width: 100rpx;
			height: 100rpx;
			left: calc(50% - 50rpx)
		}

		.ewmtext {
			position: absolute;
			bottom: 40rpx;
			width: 100%;
			text-align: center;
			color: #000;
		}

	}
</style>